package com.app.util;

import android.app.Activity;
import android.util.DisplayMetrics;


public class Utils_Hardware
{
	
	/**
	 * @Description: TODO(获取屏幕尺寸)
	 * @author zhongyou.chen
	 * @date 2013-6-20
	 * @return
	 */
	public static int[] getScreenSize(Activity activity) { // 需要activity
		int[] data = new int[2];
		DisplayMetrics mDisplayMetrics = new DisplayMetrics();
		activity.getWindowManager().getDefaultDisplay()
				.getMetrics(mDisplayMetrics);
		data[0] = mDisplayMetrics.widthPixels;
		data[1] = mDisplayMetrics.heightPixels;

		return data;
	}
	
	/*
	// OK
	public static void setListenerScreenStatus(Context context ){

		ScreenStatusBroadcastReceiver receiver = new ScreenStatusBroadcastReceiver();
		
		IntentFilter intent_filter = new IntentFilter();
		intent_filter.addAction( Intent.ACTION_SCREEN_OFF );
		intent_filter.addAction( Intent.ACTION_SCREEN_ON );
		intent_filter.addAction( Intent.ACTION_USER_PRESENT );
		
		context.registerReceiver(receiver, intent_filter);
	}
	 */
	
	
};